$(function () {
    // 获取信息
    var loading = weui.loading('loading', {
        className: 'custom-classname'
    });
    var result = Model.represent.representDetail();
    if (!sessionStorage.getItem('hmdj_stopError')) {
        sessionStorage.setItem('hmdj_stopError', true);
    } else {
        if (result.code && result.code != 15101) {
            Common.fn.formatOutput(result);
            loading.hide();
            return false;
        }
        if (result.code != 15101) {
            $('.money').val(result.data.price);
            $('.balance').val(result.data.balance);
        }
    }
    loading.hide();
});

// 修改信息
$(document).on('click', '#showTooltips', function () {
    var loading = weui.loading('loading', {
            className: 'custom-classname'
        }),
        price = $.trim($('.money').val()),
        balance = $.trim($('.balance').val());
    var result = Model.represent.modifyRepresent({
        price: price,
        balance: balance
    });
    if (result.code) {
        Common.fn.formatOutput(result);
        loading.hide();
        return false;
    }
    weui.alert(result.data, function () {
        location.reload();
    });
    loading.hide();
});